package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.DeckB22e;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class DeckB22eConverter implements AttributeConverter<DeckB22e, String> {
    @Override
    public String convertToDatabaseColumn(DeckB22e deckB22e) {
        return JSONUtil.toJsonStr(deckB22e);
    }

    @Override
    public DeckB22e convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, DeckB22e.class);
    }
}
